//
//  UserInformationTool.m
//  3H
//
//  Created by ZhiChengFengRun on 2017/8/10.
//  Copyright © 2017年 ZhiChengFengRun. All rights reserved.
//

#import "UserInformationTool.h"

@implementation UserInformationTool

+ (void)saveAccount:(NSArray *)account{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    
    //保存数据 用户信息；用户名；用户密码
    [userDefaults setObject:account  forKey:@"accountInfor"];
    [userDefaults setObject:[account objectAtIndex:0] forKey:@"userName"];
    if (account.count != 1) {
        [userDefaults setObject:[account objectAtIndex:1] forKey:@"passWord"];
    }
    
};


+ (NSArray *)getAccount{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    NSArray *array = [userDefaults objectForKey:@"account"];
    return array;
};

+ (NSString *)getUserName{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    NSString *userName = [userDefaults objectForKey:@"userName"];
    return userName;
};

+ (NSString *)getPassword{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    NSString *passWord = [userDefaults objectForKey:@"passWord"];
    return passWord;
}


@end
